// import Vue from 'vue'
// import VueRouter from 'vue-router'
// import CampusChashan from '@/views/homeword9/CampusChashan.vue'
// import CampusYueqing from '@/views/homeword9/CampusYueqing.vue'
// import CampusBinhai from '@/views/homeword9/CampusBinhai'

// Vue.use(VueRouter)

// const routes = [
//   {
//     path: '/',
//     name: 'home',
//     component: CampusBinhai
//   },
//   {
//     path: '/',
//     name: 'about',
//     // route level code-splitting
//     // this generates a separate chunk (about.[hash].js) for this route
//     // which is lazy-loaded when the route is visited.
//     component: () => import(/* webpackChunkName: "about" */ '../views/ChildComponent.vue')
//     // component:AboutView 
//   }
// ]

// const router = new VueRouter({
//   mode: 'history',
//   base: process.env.BASE_URL,
//   routes
// })

import Vue from 'vue'
import Router from 'vue-router'
import CampusBinhai from '@/views/homeword9/CampusBinhai'
import CampusChashan from '@/views/homeword9/CampusChashan'
import CampusYueqing from '@/views/homeword9/CampusYueqing'
import Login from '@/views/homeword9/Login'
import StudentSystem from '@/views/homeword9/StudentSystem'
import Navbar from '@/views/homeword9/Navbar'

Vue.use(Router)

export default new Router({
  mode: 'history',
  routes: [
    {
      path: '/',
      name: 'CampusBinhai',
      component: CampusBinhai
    },
    {
      path: '/CampusChashan',
      name: 'CampusChashan',
      component: CampusChashan
    },
    {
      path: '/CampusYueqing',
      name: 'CampusYueqing',
      component: CampusYueqing
    },
    {
      path: '/Login',
      name: 'Login',
      component: Login
    },
    {
      path: '/StudentSystem',
      name: 'StudentSystem',
      component: StudentSystem,
      beforeEnter: (to, from, next) => {
        // 路由守卫逻辑
        if (from.name === 'Login') {
          next();
        } else {
          next({ name: 'Login' });
        }
      }
    }
  ]
})